import request from '@/utils/request'

// 查询资产记录2列表
export function listEam(query) {
  return request({
    url: '/eam-a/eam/list',
    method: 'get',
    params: query
  })
}

// 查询资产记录2详细
export function getEam(manageId) {
  return request({
    url: '/eam-a/eam/' + manageId,
    method: 'get'
  })
}

// 新增资产记录2
export function addEam(data) {
  return request({
    url: '/eam-a/eam',
    method: 'post',
    data: data
  })
}

// 修改资产记录2
export function updateEam(data) {
  return request({
    url: '/eam-a/eam',
    method: 'put',
    data: data
  })
}

// 删除资产记录2
export function delEam(manageId) {
  return request({
    url: '/eam-a/eam/' + manageId,
    method: 'delete'
  })
}

// 查询下拉框---领用部门
export function listLowerBranch(manageId) {
  return request({
    url: '/eam-a/depts/list',
    method: 'get'
  })
}

//根据用户选择领用部门下拉框查询相应数据
export function listLowerBranchdata(deptId) {
  return request({
    url: '/eam-a/users/seleDept/'+deptId,
    method: 'get'
  })
}

// 查询下拉框---领用人员
export function listLowerStaff() {
  return request({
    url: '/eam-a/users/list',
    method: 'get'
  })
}

//查询仓库
export function listEntrepot() {
  return request({
    url: '/eam-a/lotion/list',
    method: 'get'
  })
}

//查询闲置资产
export function listIdleEam(data) {
  return request({
    url: '/eam-a/asset/list?useStatus='+data.useStatus+"&assetName="+data.assetName+"&TypeId="+data.TypeId+"&locationId="+data.locationId,
    method: 'get'
  })
}

//查询资产类型
export function listType() {
  return request({
    url: '/eam-a/types/list',
    method: 'get'
  })
}

//添加eam_manage_d数据
export function addEamD(data) {
  return request({
    url: '/eam-a/EamD',
    method: 'post',
    data: data
  })
}

export function getCode() {
  return request({
    url: '/eam-a/eam/getCode',
    method: 'get',
  })
}

export function updDel(manageIds) {
  return request({
    url: `/eam-a/eam/DelUpd/${manageIds.join(',')}`,
    method: 'get'
  });
}

export function updDelEamD(manageIds) {
  return request({
    url: `/eam-a/EamD/updDelEamD/${manageIds.join(',')}`,
    method: 'get'
  });
}


export function updateEamD(data) {
  return request({
    url: '/eam-a/EamD',
    method: 'put',
    data: data
  })
}

export function updateAsset(data) {
  return request({
    url: '/eam-a/asset',
    method: 'put',
    data: data
  })
}

export function getReturnCode() {
  return request({
    url: '/eam-a/returnH/getCode',
    method: 'get',
  })
}

export function addH(data) {
  return request({
    url: '/eam-a/returnH',
    method: 'post',
    data: data
  })
}

export function addD(data) {
  return request({
    url: '/eam-a/returnD',
    method: 'post',
    data: data
  })
}



